package com.virtual.rerijaapps.pet.sound;

import android.content.Context;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;

public class SoundPlayer 
{

	public static void playSound( Context context, int resSound )
	{
		MediaPlayer player = MediaPlayer.create( context, resSound );
		player.setAudioStreamType( AudioManager.STREAM_MUSIC );
		player.start();
		player.setOnCompletionListener( new OnCompletionListener() 
		{
			@Override
			public void onCompletion( MediaPlayer mp ) 
			{
				mp.reset();
				mp.release();
			}
		} );
	}
	
}
